<template>
  <div class='container-coma'>组件A {{msg}}</div>
</template>

<script>
import eventBus from '@/eventBus'
export default {
  name: 'com-a',
  data () {
    return {
      msg: ''
    }
  },
  created () {
    // 通过事件总线绑定事件
    eventBus.$on('b2a', data => {
      this.msg = data
    })
  }
}
</script>

<style scoped lang='less'></style>
